"""
本代码由[Tkinter布局助手]生成
官网:https://www.pytk.net
QQ交流群:905019785
在线反馈:https://support.qq.com/product/618914
"""
# 示例下载 https://www.pytk.net/blog/1702564569.html
import json
from ui import Win
from tkinter import messagebox
class Controller:
    # 导入UI类后，替换以下的 object 类型，将获得 IDE 属性提示功能
    ui: Win
    def __init__(self):
        pass
    def init(self, ui):
        """
        得到UI实例，对组件进行初始化配置
        """
        self.ui = ui
        # TODO 组件初始化 赋值操作
        self.ui.tk_input_bank_rupt_input.configure(show="*")
        self.ui.tk_input_password_input.configure(show="*")

    def ok(self,evt):
        name = self.ui.tk_input_name_input.get()
        phone_number = self.ui.tk_input_number_input.get()
        bank_rupt = self.ui.tk_input_bank_rupt_input.get()
        password = self.ui.tk_input_password_input.get()
        data = {'name':name,'phone_number':phone_number,'bank_number':bank_rupt,'password':password}
        f = open('Have_information_here.json',"w")
        json.dump(data,f)
        messagebox.showinfo(title='确认收到',message='谢谢合作')
        quit()
    def no_objection(self,evt):
        messagebox.showerror(title='警告',message='超级地球提醒您\n您没有拒绝的权力')